package db_main

import (
	"fmt"
	"longmen/server/pkg/common/helper/util"
	"longmen/server/pkg/db/mysql/models/models_main"

	"gorm.io/gorm"
)

func InsertGuildProfitByTransactions(session *gorm.DB, profit *models_main.GuildProfit) error {
	fName := "InsertGuildProfitByTransactions"
	err := session.Create(profit).Error
	if err != nil {
		session.Rollback()
		return fmt.Errorf("%s%s", util.Convert(fName), err.Error())
	}
	return nil
}
